function get_brake_pattern_offset(limit_speed)
{
	return 0;
}

function get_incoming_pattern_offset(limit_speed)
{
	return 0;
}

function lookup_brake_pattern(limit_speed, accum_distance, target_distance, offset_distance)
{
	local brake_pattern_table = 
	{
		[0]=	10	,
		[1]=	10	,
		[2]=	10	,
		[3]=	10	,
		[4]=	10	,
		[5]=	10	,
		[6]=	10.39230485	,
		[7]=	11.22497216	,
		[8]=	12	,
		[9]=	12.72792206	,
		[10]=	13.41640786	,
		[11]=	14.07124728	,
		[12]=	14.69693846	,
		[13]=	15.29705854	,
		[14]=	15.87450787	,
		[15]=	16.43167673	,
		[16]=	16.97056275	,
		[17]=	17.49285568	,
		[18]=	18	,
		[19]=	18.49324201	,
		[20]=	18.97366596	,
		[21]=	19.4422221	,
		[22]=	19.89974874	,
		[23]=	20.34698995	,
		[24]=	20.78460969	,
		[25]=	21.21320344	,
		[26]=	21.63330765	,
		[27]=	22.04540769	,
		[28]=	22.44994432	,
		[29]=	22.84731932	,
		[30]=	23.23790008	,
		[31]=	23.62202362	,
		[32]=	24	,
		[33]=	24.37211521	,
		[34]=	24.73863375	,
		[35]=	25.0998008	,
		[36]=	25.45584412	,
		[37]=	25.8069758	,
		[38]=	26.15339366	,
		[39]=	26.4952826	,
		[40]=	26.83281573	,
		[41]=	27.16615541	,
		[42]=	27.49545417	,
		[43]=	27.82085549	,
		[44]=	28.14249456	,
		[45]=	28.46049894	,
		[46]=	28.77498914	,
		[47]=	29.08607914	,
		[48]=	29.39387691	,
		[49]=	29.69848481	,
		[50]=	30	,
		[51]=	30.29851482	,
		[52]=	30.59411708	,
		[53]=	30.88689042	,
		[54]=	31.17691454	,
		[55]=	31.46426545	,
		[56]=	31.74901573	,
		[57]=	32.03123476	,
		[58]=	32.31098884	,
		[59]=	32.58834147	,
		[60]=	32.86335345	,
		[61]=	33.13608305	,
		[62]=	33.40658618	,
		[63]=	33.67491648	,
		[64]=	33.9411255	,
		[65]=	34.20526275	,
		[66]=	34.46737588	,
		[67]=	34.72751071	,
		[68]=	34.98571137	,
		[69]=	35.24202037	,
		[70]=	35.4964787	,
		[71]=	35.74912586	,
		[72]=	36	,
		[73]=	36.24913792	,
		[74]=	36.49657518	,
		[75]=	36.74234614	,
		[76]=	36.98648402	,
		[77]=	37.22902094	,
		[78]=	37.46998799	,
		[79]=	37.70941527	,
		[80]=	37.94733192	,
		[81]=	38.18376618	,
		[82]=	38.41874542	,
		[83]=	38.65229618	,
		[84]=	38.88444419	,
		[85]=	39.11521443	,
		[86]=	39.34463115	,
		[87]=	39.57271787	,
		[88]=	39.79949748	,
		[89]=	40.02499219	,
		[90]=	40.24922359	,
		[91]=	40.47221269	,
		[92]=	40.6939799	,
		[93]=	40.91454509	,
		[94]=	41.1339276	,
		[95]=	41.35214626	,
		[96]=	41.56921938	,
		[97]=	41.78516483	,
		[98]=	42	,
		[99]=	42.21374184	,
		[100]=	42.42640687	,
		[101]=	42.63801121	,
		[102]=	42.84857057	,
		[103]=	43.05810028	,
		[104]=	43.26661531	,
		[105]=	43.47413024	,
		[106]=	43.68065934	,
		[107]=	43.88621651	,
		[108]=	44.09081537	,
		[109]=	44.29446918	,
		[110]=	44.49719092	,
		[111]=	44.69899328	,
		[112]=	44.89988864	,
		[113]=	45.09988914	,
		[114]=	45.29900661	,
		[115]=	45.49725266	,
		[116]=	45.69463864	,
		[117]=	45.89117562	,
		[118]=	46.08687449	,
		[119]=	46.28174586	,
		[120]=	46.47580015	,
		[121]=	46.66904756	,
		[122]=	46.86149806	,
		[123]=	47.05316142	,
		[124]=	47.24404724	,
		[125]=	47.4341649	,
		[126]=	47.6235236	,
		[127]=	47.81213235	,
		[128]=	48	,
		[129]=	48.18713521	,
		[130]=	48.37354649	,
		[131]=	48.55924217	,
		[132]=	48.74423043	,
		[133]=	48.92851929	,
		[134]=	49.11211663	,
		[135]=	49.29503018	,
		[136]=	49.47726751	,
		[137]=	49.65883607	,
		[138]=	49.83974318	,
		[139]=	50.019996	,
		[140]=	50.19960159	,
		[141]=	50.37856687	,
		[142]=	50.55689864	,
		[143]=	50.73460358	,
		[144]=	50.91168825	,
		[145]=	51.0881591	,
		[146]=	51.26402247	,
		[147]=	51.4392846	,
		[148]=	51.6139516	,
		[149]=	51.7880295	,
		[150]=	51.96152423	,
		[151]=	52.13444159	,
		[152]=	52.30678732	,
		[153]=	52.47856705	,
		[154]=	52.64978632	,
		[155]=	52.82045058	,
		[156]=	52.9905652	,
		[157]=	53.16013544	,
		[158]=	53.3291665	,
		[159]=	53.4976635	,
		[160]=	53.66563146	,
		[161]=	53.83307533	,
		[162]=	54	,
		[163]=	54.16641026	,
		[164]=	54.33231083	,
		[165]=	54.49770637	,
		[166]=	54.66260147	,
		[167]=	54.82700065	,
		[168]=	54.99090834	,
		[169]=	55.15432893	,
		[170]=	55.31726674	,
		[171]=	55.47972603	,
		[172]=	55.64171097	,
		[173]=	55.80322571	,
		[174]=	55.96427432	,
		[175]=	56.1248608	,
		[176]=	56.28498912	,
		[177]=	56.44466317	,
		[178]=	56.60388679	,
		[179]=	56.76266379	,
		[180]=	56.92099788	,
		[181]=	57.07889277	,
		[182]=	57.23635209	,
		[183]=	57.39337941	,
		[184]=	57.54997828	,
		[185]=	57.70615219	,
		[186]=	57.86190457	,
		[187]=	58.01723882	,
		[188]=	58.17215829	,
		[189]=	58.32666629	,
		[190]=	58.48076607	,
		[191]=	58.63446086	,
		[192]=	58.78775383	,
		[193]=	58.94064811	,
		[194]=	59.09314681	,
		[195]=	59.24525297	,
		[196]=	59.39696962	,
		[197]=	59.54829972	,
		[198]=	59.69924623	,
		[199]=	59.84981203	,
		[200]=	60	,
		[201]=	60.14981297	,
		[202]=	60.29925373	,
		[203]=	60.44832504	,
		[204]=	60.59702963	,
		[205]=	60.74537019	,
		[206]=	60.89334939	,
		[207]=	61.04096985	,
		[208]=	61.18823416	,
		[209]=	61.3351449	,
		[210]=	61.4817046	,
		[211]=	61.62791575	,
		[212]=	61.77378085	,
		[213]=	61.91930232	,
		[214]=	62.0644826	,
		[215]=	62.20932406	,
		[216]=	62.35382907	,
		[217]=	62.49799997	,
		[218]=	62.64183905	,
		[219]=	62.78534861	,
		[220]=	62.92853089	,
		[221]=	63.07138812	,
		[222]=	63.21392252	,
		[223]=	63.35613625	,
		[224]=	63.49803147	,
		[225]=	63.63961031	,
		[226]=	63.78087488	,
		[227]=	63.92182726	,
		[228]=	64.06246951	,
		[229]=	64.20280368	,
		[230]=	64.34283177	,
		[231]=	64.48255578	,
		[232]=	64.62197769	,
		[233]=	64.76109943	,
		[234]=	64.89992296	,
		[235]=	65.03845017	,
		[236]=	65.17668295	,
		[237]=	65.31462317	,
		[238]=	65.45227269	,
		[239]=	65.58963333	,
		[240]=	65.7267069	,
		[241]=	65.8634952	,
		[242]=	66	,
		[243]=	66.13622306	,
		[244]=	66.2721661	,
		[245]=	66.40783086	,
		[246]=	66.54321904	,
		[247]=	66.67833231	,
		[248]=	66.81317235	,
		[249]=	66.94774081	,
		[250]=	67.08203932	,
		[251]=	67.21606951	,
		[252]=	67.34983296	,
		[253]=	67.48333128	,
		[254]=	67.61656602	,
		[255]=	67.74953874	,
		[256]=	67.88225099	,
		[257]=	68.01470429	,
		[258]=	68.14690015	,
		[259]=	68.27884006	,
		[260]=	68.41052551	,
		[261]=	68.54195795	,
		[262]=	68.67313885	,
		[263]=	68.80406965	,
		[264]=	68.93475176	,
		[265]=	69.0651866	,
		[266]=	69.19537557	,
		[267]=	69.32532005	,
		[268]=	69.45502142	,
		[269]=	69.58448103	,
		[270]=	69.71370023	,
		[271]=	69.84268036	,
		[272]=	69.97142274	,
		[273]=	70.09992867	,
		[274]=	70.22819946	,
		[275]=	70.3562364	,
		[276]=	70.48404075	,
		[277]=	70.61161378	,
		[278]=	70.73895674	,
		[279]=	70.86607087	,
		[280]=	70.9929574	,
		[281]=	71.11961755	,
		[282]=	71.24605252	,
		[283]=	71.37226352	,
		[284]=	71.49825173	,
		[285]=	71.62401832	,
		[286]=	71.74956446	,
		[287]=	71.8748913	,
		[288]=	72	,
		[289]=	72.12489168	,
		[290]=	72.24956747	,
		[291]=	72.37402849	,
		[292]=	72.49827584	,
		[293]=	72.62231062	,
		[294]=	72.74613392	,
		[295]=	72.86974681	,
		[296]=	72.99315036	,
		[297]=	73.11634564	,
		[298]=	73.23933369	,
		[299]=	73.36211556	,
		[300]=	73.48469228	,
		[301]=	73.60706488	,
		[302]=	73.72923436	,
		[303]=	73.85120175	,
		[304]=	73.97296804	,
		[305]=	74.09453421	,
		[306]=	74.21590126	,
		[307]=	74.33707016	,
		[308]=	74.45804188	,
		[309]=	74.57881737	,
		[310]=	74.69939759	,
		[311]=	74.81978348	,
		[312]=	74.93997598	,
		[313]=	75.05997602	,
		[314]=	75.17978452	,
		[315]=	75.29940239	,
		[316]=	75.41883054	,
		[317]=	75.53806987	,
		[318]=	75.65712128	,
		[319]=	75.77598564	,
		[320]=	75.89466384	,
		[321]=	76.01315676	,
		[322]=	76.13146524	,
		[323]=	76.24959016	,
		[324]=	76.36753237	,
		[325]=	76.4852927	,
		[326]=	76.60287201	,
		[327]=	76.72027112	,
		[328]=	76.83749085	,
		[329]=	76.95453203	,
		[330]=	77.07139547	,
		[331]=	77.18808198	,
		[332]=	77.30459236	,
		[333]=	77.4209274	,
		[334]=	77.5370879	,
		[335]=	77.65307463	,
		[336]=	77.76888838	,
		[337]=	77.88452991	,
		[338]=	78	,
		[339]=	78.1152994	,
		[340]=	78.23042886	,
		[341]=	78.34538914	,
		[342]=	78.46018098	,
		[343]=	78.57480512	,
		[344]=	78.68926229	,
		[345]=	78.80355322	,
		[346]=	78.91767863	,
		[347]=	79.03163923	,
		[348]=	79.14543575	,
		[349]=	79.25906888	,
		[350]=	79.37253933	,
		[351]=	79.4858478	,
		[352]=	79.59899497	,
		[353]=	79.71198153	,
		[354]=	79.82480817	,
		[355]=	79.93747557	,
		[356]=	80.04998438	,
		[357]=	80.1623353	,
		[358]=	80.27452896	,
		[359]=	80.38656604	,
		[360]=	80.49844719	,
		[361]=	80.61017306	,
		[362]=	80.72174428	,
		[363]=	80.83316151	,
		[364]=	80.94442538	,
		[365]=	81.05553652	,
		[366]=	81.16649555	,
		[367]=	81.2773031	,
		[368]=	81.3879598	,
		[369]=	81.49846624	,
		[370]=	81.60882305	,
		[371]=	81.71903083	,
		[372]=	81.82909018	,
		[373]=	81.9390017	,
		[374]=	82.04876599	,
		[375]=	82.15838363	,
		[376]=	82.2678552	,
		[377]=	82.37718131	,
		[378]=	82.48636251	,
		[379]=	82.59539939	,
		[380]=	82.70429251	,
		[381]=	82.81304245	,
		[382]=	82.92164977	,
		[383]=	83.03011502	,
		[384]=	83.13843876	,
		[385]=	83.24662155	,
		[386]=	83.35466394	,
		[387]=	83.46256646	,
		[388]=	83.57032966	,
		[389]=	83.67795409	,
		[390]=	83.78544026	,
		[391]=	83.89278872	,
		[392]=	84	,
		[393]=	84.10707461	,
		[394]=	84.21401309	,
		[395]=	84.32081594	,
		[396]=	84.42748368	,
		[397]=	84.53401682	,
		[398]=	84.64041588	,
		[399]=	84.74668135	,
		[400]=	84.85281374	,
		[401]=	84.95881355	,
		[402]=	85.06468127	,
		[403]=	85.1704174	,
		[404]=	85.27602242	,
		[405]=	85.38149682	,
		[406]=	85.48684109	,
		[407]=	85.59205571	,
		[408]=	85.69714114	,
		[409]=	85.80209788	,
		[410]=	85.90692638	,
		[411]=	86.01162712	,
		[412]=	86.11620057	,
		[413]=	86.22064718	,
		[414]=	86.32496742	,
		[415]=	86.42916175	,
		[416]=	86.53323061	,
		[417]=	86.63717447	,
		[418]=	86.74099377	,
		[419]=	86.84468896	,
		[420]=	86.94826048	,
		[421]=	87.05170877	,
		[422]=	87.15503428	,
		[423]=	87.25823743	,
		[424]=	87.36131867	,
		[425]=	87.46427842	,
		[426]=	87.56711712	,
		[427]=	87.66983518	,
		[428]=	87.77243303	,
		[429]=	87.8749111	,
		[430]=	87.97726979	,
		[431]=	88.07950954	,
		[432]=	88.18163074	,
		[433]=	88.28363382	,
		[434]=	88.38551918	,
		[435]=	88.48728722	,
		[436]=	88.58893836	,
		[437]=	88.69047299	,
		[438]=	88.79189152	,
		[439]=	88.89319434	,
		[440]=	88.99438185	,
		[441]=	89.09545443	,
		[442]=	89.19641248	,
		[443]=	89.2972564	,
		[444]=	89.39798655	,
		[445]=	89.49860334	,
		[446]=	89.59910714	,
		[447]=	89.69949833	,
		[448]=	89.79977728	,
		[449]=	89.89994438	,
		[450]=	90	,
		[451]=	90.09994451	,
		[452]=	90.19977827	,
		[453]=	90.29950166	,
		[454]=	90.39911504	,
		[455]=	90.49861877	,
		[456]=	90.59801322	,
		[457]=	90.69729875	,
		[458]=	90.7964757	,
		[459]=	90.89554445	,
		[460]=	90.99450533	,
		[461]=	91.0933587	,
		[462]=	91.19210492	,
		[463]=	91.29074433	,
		[464]=	91.38927727	,
		[465]=	91.48770409	,
		[466]=	91.58602513	,
		[467]=	91.68424074	,
		[468]=	91.78235124	,
		[469]=	91.88035699	,
		[470]=	91.9782583	,
		[471]=	92.07605552	,
		[472]=	92.17374897	,
		[473]=	92.271339	,
		[474]=	92.36882591	,
		[475]=	92.46621004	,
		[476]=	92.56349172	,
		[477]=	92.66067127	,
		[478]=	92.757749	,
		[479]=	92.85472524	,
		[480]=	92.95160031	,
		[481]=	93.04837452	,
		[482]=	93.14504818	,
		[483]=	93.24162161	,
		[484]=	93.33809512	,
		[485]=	93.43446901	,
		[486]=	93.53074361	,
		[487]=	93.62691921	,
		[488]=	93.72299611	,
		[489]=	93.81897463	,
		[490]=	93.91485505	,
		[491]=	94.0106377	,
		[492]=	94.10632285	,
		[493]=	94.20191081	,
		[494]=	94.29740187	,
		[495]=	94.39279634	,
		[496]=	94.48809449	,
		[497]=	94.58329662	,
		[498]=	94.67840303	,
		[499]=	94.77341399	,
		[500]=	94.86832981	,
		[501]=	94.96315075	,
		[502]=	95.05787711	,
		[503]=	95.15250916	,
		[504]=	95.2470472	,
		[505]=	95.34149149	,
		[506]=	95.43584232	,
		[507]=	95.53009997	,
		[508]=	95.6242647	,
		[509]=	95.7183368	,
		[510]=	95.81231654	,
		[511]=	95.90620418	,
		[512]=	96	,
		[513]=	96.09370427	,
		[514]=	96.18731725	,
		[515]=	96.28083922	,
		[516]=	96.37427043	,
		[517]=	96.46761114	,
		[518]=	96.56086164	,
		[519]=	96.65402216	,
		[520]=	96.74709298	,
		[521]=	96.84007435	,
		[522]=	96.93296653	,
		[523]=	97.02576977	,
		[524]=	97.11848434	,
		[525]=	97.21111048	,
		[526]=	97.30364844	,
		[527]=	97.39609848	,
		[528]=	97.48846086	,
		[529]=	97.5807358	,
		[530]=	97.67292358	,
		[531]=	97.76502442	,
		[532]=	97.85703858	,
		[533]=	97.9489663	,
		[534]=	98.04080783	,
		[535]=	98.1325634	,
		[536]=	98.22423326	,
		[537]=	98.31581765	,
		[538]=	98.4073168	,
		[539]=	98.49873096	,
		[540]=	98.59006035	,
		[541]=	98.68130522	,
		[542]=	98.7724658	,
		[543]=	98.86354232	,
		[544]=	98.95453501	,
		[545]=	99.04544412	,
		[546]=	99.13626985	,
		[547]=	99.22701245	,
		[548]=	99.31767214	,
		[549]=	99.40824915	,
		[550]=	99.49874371	,
		[551]=	99.58915604	,
		[552]=	99.67948636	,
		[553]=	99.76973489	,
		[554]=	99.85990186	,
		[555]=	99.94998749	,
		[556]=	100.039992	,
		[557]=	100.1299156	,
		[558]=	100.2197585	,
		[559]=	100.309521	,
		[560]=	100.3992032	,
		[561]=	100.4888053	,
		[562]=	100.5783277	,
		[563]=	100.6677704	,
		[564]=	100.7571337	,
		[565]=	100.8464179	,
		[566]=	100.935623	,
		[567]=	101.0247494	,
		[568]=	101.1137973	,
		[569]=	101.2027668	,
		[570]=	101.2916581	,
		[571]=	101.3804715	,
		[572]=	101.4692072	,
		[573]=	101.5578653	,
		[574]=	101.6464461	,
		[575]=	101.7349497	,
		[576]=	101.8233765	,
		[577]=	101.9117265	,
		[578]=	102	,
		[579]=	102.0881972	,
		[580]=	102.1763182	,
		[581]=	102.2643633	,
		[582]=	102.3523327	,
		[583]=	102.4402265	,
		[584]=	102.5280449	,
		[585]=	102.6157883	,
		[586]=	102.7034566	,
		[587]=	102.7910502	,
		[588]=	102.8785692	,
		[589]=	102.9660138	,
		[590]=	103.0533842	,
		[591]=	103.1406806	,
		[592]=	103.2279032	,
		[593]=	103.3150521	,
		[594]=	103.4021276	,
		[595]=	103.4891299	,
		[596]=	103.576059	,
		[597]=	103.6629153	,
		[598]=	103.7496988	,
		[599]=	103.8364098	,
		[600]=	103.9230485	,
		[601]=	104.0096149	,
		[602]=	104.0961094	,
		[603]=	104.1825321	,
		[604]=	104.2688832	,
		[605]=	104.3551628	,
		[606]=	104.4413711	,
		[607]=	104.5275083	,
		[608]=	104.6135746	,
		[609]=	104.6995702	,
		[610]=	104.7854952	,
		[611]=	104.8713498	,
		[612]=	104.9571341	,
		[613]=	105.0428484	,
		[614]=	105.1284928	,
		[615]=	105.2140675	,
		[616]=	105.2995726	,
		[617]=	105.3850084	,
		[618]=	105.470375	,
		[619]=	105.5556725	,
		[620]=	105.6409012	,
		[621]=	105.7260611	,
		[622]=	105.8111525	,
		[623]=	105.8961756	,
		[624]=	105.9811304	,
		[625]=	106.0660172	,
		[626]=	106.1508361	,
		[627]=	106.2355873	,
		[628]=	106.3202709	,
		[629]=	106.4048871	,
		[630]=	106.4894361	,
		[631]=	106.573918	,
		[632]=	106.658333	,
		[633]=	106.7426812	,
		[634]=	106.8269629	,
		[635]=	106.9111781	,
		[636]=	106.995327	,
		[637]=	107.0794098	,
		[638]=	107.1634266	,
		[639]=	107.2473776	,
		[640]=	107.3312629	,
		[641]=	107.4150827	,
		[642]=	107.4988372	,
		[643]=	107.5825265	,
		[644]=	107.6661507	,
		[645]=	107.74971	,
		[646]=	107.8332045	,
		[647]=	107.9166345	,
		[648]=	108	,
		[649]=	108.0833012	,
		[650]=	108.1665383	,
		[651]=	108.2497113	,
		[652]=	108.3328205	,
		[653]=	108.415866	,
		[654]=	108.4988479	,
		[655]=	108.5817664	,
		[656]=	108.6646217	,
		[657]=	108.7474138	,
		[658]=	108.8301429	,
		[659]=	108.9128092	,
		[660]=	108.9954127	,
		[661]=	109.0779538	,
		[662]=	109.1604324	,
		[663]=	109.2428487	,
		[664]=	109.3252029	,
		[665]=	109.4074952	,
		[666]=	109.4897255	,
		[667]=	109.5718942	,
		[668]=	109.6540013	,
		[669]=	109.7360469	,
		[670]=	109.8180313	,
		[671]=	109.8999545	,
		[672]=	109.9818167	,
		[673]=	110.063618	,
		[674]=	110.1453585	,
		[675]=	110.2270384	,
		[676]=	110.3086579	,
		[677]=	110.390217	,
		[678]=	110.4717158	,
		[679]=	110.5531546	,
		[680]=	110.6345335	,
		[681]=	110.7158525	,
		[682]=	110.7971119	,
		[683]=	110.8783117	,
		[684]=	110.9594521	,
		[685]=	111.0405331	,
		[686]=	111.1215551	,
		[687]=	111.202518	,
		[688]=	111.2834219	,
		[689]=	111.3642672	,
		[690]=	111.4450537	,
		[691]=	111.5257818	,
		[692]=	111.6064514	,
		[693]=	111.6870628	,
		[694]=	111.7676161	,
		[695]=	111.8481113	,
		[696]=	111.9285486	,
		[697]=	112.0089282	,
		[698]=	112.0892502	,
		[699]=	112.1695146	,
		[700]=	112.2497216	,
		[701]=	112.3298714	,
		[702]=	112.409964	,
		[703]=	112.4899996	,
		[704]=	112.5699782	,
		[705]=	112.6499001	,
		[706]=	112.7297654	,
		[707]=	112.8095741	,
		[708]=	112.8893263	,
		[709]=	112.9690223	,
		[710]=	113.0486621	,
		[711]=	113.1282458	,
		[712]=	113.2077736	,
		[713]=	113.2872455	,
		[714]=	113.3666618	,
		[715]=	113.4460224	,
		[716]=	113.5253276	,
		[717]=	113.6045774	,
		[718]=	113.6837719	,
		[719]=	113.7629114	,
		[720]=	113.8419958	,
		[721]=	113.9210253	,
		[722]=	114	,
		[723]=	114.0789201	,
		[724]=	114.1577855	,
		[725]=	114.2365966	,
		[726]=	114.3153533	,
		[727]=	114.3940558	,
		[728]=	114.4727042	,
		[729]=	114.5512986	,
		[730]=	114.629839	,
		[731]=	114.7083258	,
		[732]=	114.7867588	,
		[733]=	114.8651383	,
		[734]=	114.9434644	,
		[735]=	115.0217371	,
		[736]=	115.0999566	,
		[737]=	115.1781229	,
		[738]=	115.2562363	,
		[739]=	115.3342967	,
		[740]=	115.4123044	,
		[741]=	115.4902593	,
		[742]=	115.5681617	,
		[743]=	115.6460116	,
		[744]=	115.7238091	,
		[745]=	115.8015544	,
		[746]=	115.8792475	,
		[747]=	115.9568885	,
		[748]=	116.0344776	,
		[749]=	116.1120149	,
		[750]=	116.1895004	,
		[751]=	116.2669343	,
		[752]=	116.3443166	,
		[753]=	116.4216475	,
		[754]=	116.498927	,
		[755]=	116.5761554	,
		[756]=	116.6533326	,
		[757]=	116.7304588	,
		[758]=	116.807534	,
		[759]=	116.8845584	,
		[760]=	116.9615321	,
		[761]=	117.0384552	,
		[762]=	117.1153278	,
		[763]=	117.1921499	,
		[764]=	117.2689217	,
		[765]=	117.3456433	,
		[766]=	117.4223147	,
		[767]=	117.4989362	,
		[768]=	117.5755077	,
		[769]=	117.6520293	,
		[770]=	117.7285012	,
		[771]=	117.8049235	,
		[772]=	117.8812962	,
		[773]=	117.9576195	,
		[774]=	118.0338934	,
		[775]=	118.1101181	,
		[776]=	118.1862936	,
		[777]=	118.2624201	,
		[778]=	118.3384975	,
		[779]=	118.4145261	,
		[780]=	118.4905059	,
		[781]=	118.5664371	,
		[782]=	118.6423196	,
		[783]=	118.7181536	,
		[784]=	118.7939392	,
		[785]=	118.8696765	,
		[786]=	118.9453656	,
		[787]=	119.0210065	,
		[788]=	119.0965994	,
		[789]=	119.1721444	,
		[790]=	119.2476415	,
		[791]=	119.3230908	,
		[792]=	119.3984925	,
		[793]=	119.4738465	,
		[794]=	119.5491531	,
		[795]=	119.6244122	,
		[796]=	119.6996241	,
		[797]=	119.7747887	,
		[798]=	119.8499061	,
		[799]=	119.9249765	,
		[800]=	120	,
		[801]=	120.0749766	,
		[802]=	120.1499064	,
		[803]=	120.2247895	,
		[804]=	120.2996259	,
		[805]=	120.3744159	,
		[806]=	120.4491594	,
		[807]=	120.5238566	,
		[808]=	120.5985075	,
		[809]=	120.6731122	,
		[810]=	120.7476708	,
		[811]=	120.8221834	,
		[812]=	120.8966501	,
		[813]=	120.9710709	,
		[814]=	121.045446	,
		[815]=	121.1197754	,
		[816]=	121.1940593	,
		[817]=	121.2682976	,
		[818]=	121.3424905	,
		[819]=	121.4166381	,
		[820]=	121.4907404	,
		[821]=	121.5647975	,
		[822]=	121.6388096	,
		[823]=	121.7127767	,
		[824]=	121.7866988	,
		[825]=	121.8605761	,
		[826]=	121.9344086	,
		[827]=	122.0081964	,
		[828]=	122.0819397	,
		[829]=	122.1556384	,
		[830]=	122.2292927	,
		[831]=	122.3029027	,
		[832]=	122.3764683	,
		[833]=	122.4499898	,
		[834]=	122.5234671	,
		[835]=	122.5969005	,
		[836]=	122.6702898	,
		[837]=	122.7436353	,
		[838]=	122.8169369	,
		[839]=	122.8901949	,
		[840]=	122.9634092	,
		[841]=	123.0365799	,
		[842]=	123.1097072	,
		[843]=	123.182791	,
		[844]=	123.2558315	,
		[845]=	123.3288287	,
		[846]=	123.4017828	,
		[847]=	123.4746938	,
		[848]=	123.5475617	,
		[849]=	123.6203867	,
		[850]=	123.6931688	,
		[851]=	123.7659081	,
		[852]=	123.8386046	,
		[853]=	123.9112586	,
		[854]=	123.9838699	,
		[855]=	124.0564388	,
		[856]=	124.1289652	,
		[857]=	124.2014493	,
		[858]=	124.2738911	,
		[859]=	124.3462907	,
		[860]=	124.4186481	,
		[861]=	124.4909635	,
		[862]=	124.563237	,
		[863]=	124.6354685	,
		[864]=	124.7076581	,
		[865]=	124.7798061	,
		[866]=	124.8519123	,
		[867]=	124.9239769	,
		[868]=	124.9959999	,
		[869]=	125.0679815	,
		[870]=	125.1399217	,
		[871]=	125.2118205	,
		[872]=	125.2836781	,
		[873]=	125.3554945	,
		[874]=	125.4272698	,
		[875]=	125.499004	,
		[876]=	125.5706972	,
		[877]=	125.6423495	,
		[878]=	125.713961	,
		[879]=	125.7855318	,
		[880]=	125.8570618	,
		[881]=	125.9285512	,
		[882]=	126	,
		[883]=	126.0714083	,
		[884]=	126.1427762	,
		[885]=	126.2141038	,
		[886]=	126.2853911	,
		[887]=	126.3566381	,
		[888]=	126.427845	,
		[889]=	126.4990119	,
		[890]=	126.5701387	,
		[891]=	126.6412255	,
		[892]=	126.7122725	,
		[893]=	126.7832797	,
		[894]=	126.8542471	,
		[895]=	126.9251748	,
		[896]=	126.9960629	,
		[897]=	127.0669115	,
		[898]=	127.1377206	,
		[899]=	127.2084903	,
		[900]=	127.2792206	,
		[901]=	127.3499117	,
		[902]=	127.4205635	,
		[903]=	127.4911762	,
		[904]=	127.5617498	,
		[905]=	127.6322843	,
		[906]=	127.7027799	,
		[907]=	127.7732366	,
		[908]=	127.8436545	,
		[909]=	127.9140336	,
		[910]=	127.984374	,
		[911]=	128.0546758	,
		[912]=	128.124939	,
		[913]=	128.1951637	,
		[914]=	128.26535	,
		[915]=	128.3354978	,
		[916]=	128.4056074	,
		[917]=	128.4756786	,
		[918]=	128.5457117	,
		[919]=	128.6157067	,
		[920]=	128.6856635	,
		[921]=	128.7555824	,
		[922]=	128.8254633	,
		[923]=	128.8953064	,
		[924]=	128.9651116	,
		[925]=	129.034879	,
		[926]=	129.1046087	,
		[927]=	129.1743008	,
		[928]=	129.2439554	,
		[929]=	129.3135724	,
		[930]=	129.3831519	,
		[931]=	129.4526941	,
		[932]=	129.5221989	,
		[933]=	129.5916664	,
		[934]=	129.6610967	,
		[935]=	129.7304899	,
		[936]=	129.7998459	,
		[937]=	129.8691649	,
		[938]=	129.938447	,
		[939]=	130.0076921	,
		[940]=	130.0769003	,
		[941]=	130.1460718	,
		[942]=	130.2152065	,
		[943]=	130.2843045	,
		[944]=	130.3533659	,
		[945]=	130.4223907	,
		[946]=	130.491379	,
		[947]=	130.5603309	,
		[948]=	130.6292463	,
		[949]=	130.6981255	,
		[950]=	130.7669683	,
		[951]=	130.8357749	,
		[952]=	130.9045454	,
		[953]=	130.9732797	,
		[954]=	131.041978	,
		[955]=	131.1106403	,
		[956]=	131.1792667	,
		[957]=	131.2478571	,
		[958]=	131.3164118	,
		[959]=	131.3849306	,
		[960]=	131.4534138	,
		[961]=	131.5218613	,
		[962]=	131.5902732	,
		[963]=	131.6586495	,
		[964]=	131.7269904	,
		[965]=	131.7952958	,
		[966]=	131.8635659	,
		[967]=	131.9318006	,
		[968]=	132	,
		[969]=	132.0681642	,
		[970]=	132.1362933	,
		[971]=	132.2043872	,
		[972]=	132.2724461	,
		[973]=	132.34047	,
		[974]=	132.4084589	,
		[975]=	132.476413	,
		[976]=	132.5443322	,
		[977]=	132.6122166	,
		[978]=	132.6800663	,
		[979]=	132.7478813	,
		[980]=	132.8156617	,
		[981]=	132.8834075	,
		[982]=	132.9511188	,
		[983]=	133.0187957	,
		[984]=	133.0864381	,
		[985]=	133.1540461	,
		[986]=	133.2216199	,
		[987]=	133.2891593	,
		[988]=	133.3566646	,
		[989]=	133.4241357	,
		[990]=	133.4915728	,
		[991]=	133.5589757	,
		[992]=	133.6263447	,
		[993]=	133.6936797	,
		[994]=	133.7609809	,
		[995]=	133.8282481	,
		[996]=	133.8954816	,
		[997]=	133.9626814	,
		[998]=	134.0298474	,
		[999]=	134.0969798	,
		[1000]=	134.1640786	,
	};

	local true_idx = (target_distance - accum_distance);

	if (true_idx <= 0)
	{
		return 15.0;
	}
	else if (true_idx > 1000)
	{
		return brake_pattern_table[1000];
	}
	else
	{
		true_idx = true_idx - (true_idx % 4);
		return brake_pattern_table[true_idx.tointeger()];
	}
}

function lookup_incoming_pattern(limit_speed, accum_distance, target_distance, offset_distance)
{
	local incoming_pattern_table = 
	{
		[0]=	5	,
		[1]=	5	,
		[2]=	5	,
		[3]=	5	,
		[4]=	5	,
		[5]=	5	,
		[6]=	5	,
		[7]=	5.64894361	,
		[8]=	6.384199577	,
		[9]=	7.074767078	,
		[10]=	7.727922061	,
		[11]=	8.349157277	,
		[12]=	8.942740046	,
		[13]=	9.512063947	,
		[14]=	10.05988048	,
		[15]=	10.58845727	,
		[16]=	11.09968944	,
		[17]=	11.59518002	,
		[18]=	12.07629936	,
		[19]=	12.54422982	,
		[20]=	13	,
		[21]=	13.44451138	,
		[22]=	13.87855927	,
		[23]=	14.30284953	,
		[24]=	14.71801207	,
		[25]=	15.1246118	,
		[26]=	15.52315765	,
		[27]=	15.91411007	,
		[28]=	16.29788722	,
		[29]=	16.67487024	,
		[30]=	17.04540769	,
		[31]=	17.40981928	,
		[32]=	17.76839915	,
		[33]=	18.12141864	,
		[34]=	18.46912866	,
		[35]=	18.8117618	,
		[36]=	19.14953416	,
		[37]=	19.48264692	,
		[38]=	19.81128775	,
		[39]=	20.13563208	,
		[40]=	20.45584412	,
		[41]=	20.77207791	,
		[42]=	21.08447814	,
		[43]=	21.39318094	,
		[44]=	21.69831455	,
		[45]=	22	,
		[46]=	22.2983516	,
		[47]=	22.59347749	,
		[48]=	22.88548009	,
		[49]=	23.17445652	,
		[50]=	23.46049894	,
		[51]=	23.74369496	,
		[52]=	24.02412789	,
		[53]=	24.30187707	,
		[54]=	24.57701811	,
		[55]=	24.84962311	,
		[56]=	25.11976096	,
		[57]=	25.38749743	,
		[58]=	25.65289546	,
		[59]=	25.91601527	,
		[60]=	26.17691454	,
		[61]=	26.43564855	,
		[62]=	26.69227035	,
		[63]=	26.94683083	,
		[64]=	27.19937888	,
		[65]=	27.44996148	,
		[66]=	27.69862382	,
		[67]=	27.94540939	,
		[68]=	28.19036005	,
		[69]=	28.43351612	,
		[70]=	28.67491648	,
		[71]=	28.91459863	,
		[72]=	29.15259873	,
		[73]=	29.38895171	,
		[74]=	29.62369131	,
		[75]=	29.85685012	,
		[76]=	30.08845964	,
		[77]=	30.31855037	,
		[78]=	30.54715178	,
		[79]=	30.77429245	,
		[80]=	31	,
		[81]=	31.22430124	,
		[82]=	31.44722212	,
		[83]=	31.66878782	,
		[84]=	31.88902276	,
		[85]=	32.10795063	,
		[86]=	32.32559444	,
		[87]=	32.54197651	,
		[88]=	32.75711853	,
		[89]=	32.9710416	,
		[90]=	33.18376618	,
		[91]=	33.39531221	,
		[92]=	33.60569906	,
		[93]=	33.81494558	,
		[94]=	34.0230701	,
		[95]=	34.23009049	,
		[96]=	34.43602414	,
		[97]=	34.64088798	,
		[98]=	34.84469852	,
		[99]=	35.04747183	,
		[100]=	35.24922359	,
		[101]=	35.4499691	,
		[102]=	35.64972325	,
		[103]=	35.84850058	,
		[104]=	36.0463153	,
		[105]=	36.24318125	,
		[106]=	36.43911196	,
		[107]=	36.63412062	,
		[108]=	36.82822014	,
		[109]=	37.02142311	,
		[110]=	37.21374184	,
		[111]=	37.40518836	,
		[112]=	37.59577444	,
		[113]=	37.78551157	,
		[114]=	37.97441099	,
		[115]=	38.16248371	,
		[116]=	38.34974048	,
		[117]=	38.53619184	,
		[118]=	38.72184809	,
		[119]=	38.9067193	,
		[120]=	39.09081537	,
		[121]=	39.27414595	,
		[122]=	39.45672053	,
		[123]=	39.63854836	,
		[124]=	39.81963855	,
		[125]=	40	,
		[126]=	40.17964143	,
		[127]=	40.35857141	,
		[128]=	40.53679831	,
		[129]=	40.71433036	,
		[130]=	40.89117562	,
		[131]=	41.06734201	,
		[132]=	41.24283728	,
		[133]=	41.41766905	,
		[134]=	41.59184478	,
		[135]=	41.7653718	,
		[136]=	41.93825732	,
		[137]=	42.11050838	,
		[138]=	42.28213193	,
		[139]=	42.45313478	,
		[140]=	42.6235236	,
		[141]=	42.79330497	,
		[142]=	42.96248534	,
		[143]=	43.13107105	,
		[144]=	43.29906831	,
		[145]=	43.46648326	,
		[146]=	43.63332191	,
		[147]=	43.79959016	,
		[148]=	43.96529383	,
		[149]=	44.13043863	,
		[150]=	44.29503018	,
		[151]=	44.45907399	,
		[152]=	44.62257551	,
		[153]=	44.78554007	,
		[154]=	44.94797293	,
		[155]=	45.10987927	,
		[156]=	45.27126416	,
		[157]=	45.43213261	,
		[158]=	45.59248956	,
		[159]=	45.75233985	,
		[160]=	45.91168825	,
		[161]=	46.07053945	,
		[162]=	46.22889809	,
		[163]=	46.38676873	,
		[164]=	46.54415583	,
		[165]=	46.70106382	,
		[166]=	46.85749705	,
		[167]=	47.0134598	,
		[168]=	47.16895629	,
		[169]=	47.32399067	,
		[170]=	47.47856705	,
		[171]=	47.63268946	,
		[172]=	47.78636188	,
		[173]=	47.93958821	,
		[174]=	48.09237233	,
		[175]=	48.24471805	,
		[176]=	48.39662911	,
		[177]=	48.54810921	,
		[178]=	48.699162	,
		[179]=	48.84979109	,
		[180]=	49	,
		[181]=	49.14979224	,
		[182]=	49.29917126	,
		[183]=	49.44814046	,
		[184]=	49.5967032	,
		[185]=	49.74486277	,
		[186]=	49.89262246	,
		[187]=	50.03998547	,
		[188]=	50.18695498	,
		[189]=	50.33353414	,
		[190]=	50.47972603	,
		[191]=	50.62553371	,
		[192]=	50.77096019	,
		[193]=	50.91600844	,
		[194]=	51.06068141	,
		[195]=	51.20498199	,
		[196]=	51.34891303	,
		[197]=	51.49247738	,
		[198]=	51.6356778	,
		[199]=	51.77851706	,
		[200]=	51.92099788	,
		[201]=	52.06312294	,
		[202]=	52.2048949	,
		[203]=	52.34631636	,
		[204]=	52.48738992	,
		[205]=	52.62811814	,
		[206]=	52.76850353	,
		[207]=	52.90854859	,
		[208]=	53.04825579	,
		[209]=	53.18762755	,
		[210]=	53.32666629	,
		[211]=	53.46537437	,
		[212]=	53.60375415	,
		[213]=	53.74180794	,
		[214]=	53.87953804	,
		[215]=	54.01694672	,
		[216]=	54.15403621	,
		[217]=	54.29080873	,
		[218]=	54.42726647	,
		[219]=	54.56341159	,
		[220]=	54.69924623	,
		[221]=	54.8347725	,
		[222]=	54.9699925	,
		[223]=	55.10490829	,
		[224]=	55.23952191	,
		[225]=	55.37383539	,
		[226]=	55.50785073	,
		[227]=	55.6415699	,
		[228]=	55.77499486	,
		[229]=	55.90812754	,
		[230]=	56.04096985	,
		[231]=	56.17352368	,
		[232]=	56.30579092	,
		[233]=	56.4377734	,
		[234]=	56.56947296	,
		[235]=	56.7008914	,
		[236]=	56.83203053	,
		[237]=	56.96289212	,
		[238]=	57.09347792	,
		[239]=	57.22378966	,
		[240]=	57.35382907	,
		[241]=	57.48359785	,
		[242]=	57.61309767	,
		[243]=	57.74233021	,
		[244]=	57.87129711	,
		[245]=	58	,
		[246]=	58.1284405	,
		[247]=	58.25662021	,
		[248]=	58.3845407	,
		[249]=	58.51220355	,
		[250]=	58.63961031	,
		[251]=	58.7667625	,
		[252]=	58.89366166	,
		[253]=	59.02030928	,
		[254]=	59.14670685	,
		[255]=	59.27285586	,
		[256]=	59.39875775	,
		[257]=	59.52441398	,
		[258]=	59.64982599	,
		[259]=	59.77499518	,
		[260]=	59.89992296	,
		[261]=	60.02461073	,
		[262]=	60.14905986	,
		[263]=	60.27327171	,
		[264]=	60.39724765	,
		[265]=	60.520989	,
		[266]=	60.6444971	,
		[267]=	60.76777326	,
		[268]=	60.89081878	,
		[269]=	61.01363496	,
		[270]=	61.13622306	,
		[271]=	61.25858435	,
		[272]=	61.38072009	,
		[273]=	61.50263153	,
		[274]=	61.62431988	,
		[275]=	61.74578638	,
		[276]=	61.86703224	,
		[277]=	61.98805864	,
		[278]=	62.10886678	,
		[279]=	62.22945783	,
		[280]=	62.34983296	,
		[281]=	62.46999333	,
		[282]=	62.58994008	,
		[283]=	62.70967435	,
		[284]=	62.82919725	,
		[285]=	62.94850992	,
		[286]=	63.06761344	,
		[287]=	63.18650893	,
		[288]=	63.30519746	,
		[289]=	63.42368011	,
		[290]=	63.54195795	,
		[291]=	63.66003204	,
		[292]=	63.77790343	,
		[293]=	63.89557315	,
		[294]=	64.01304225	,
		[295]=	64.13031173	,
		[296]=	64.24738262	,
		[297]=	64.36425592	,
		[298]=	64.48093264	,
		[299]=	64.59741375	,
		[300]=	64.71370023	,
		[301]=	64.82979307	,
		[302]=	64.94569322	,
		[303]=	65.06140164	,
		[304]=	65.17691928	,
		[305]=	65.29224708	,
		[306]=	65.40738598	,
		[307]=	65.52233689	,
		[308]=	65.63710073	,
		[309]=	65.75167843	,
		[310]=	65.86607087	,
		[311]=	65.98027895	,
		[312]=	66.09430357	,
		[313]=	66.2081456	,
		[314]=	66.32180592	,
		[315]=	66.4352854	,
		[316]=	66.54858489	,
		[317]=	66.66170525	,
		[318]=	66.77464733	,
		[319]=	66.88741197	,
		[320]=	67	,
		[321]=	67.11241225	,
		[322]=	67.22464953	,
		[323]=	67.33671267	,
		[324]=	67.44860247	,
		[325]=	67.56031973	,
		[326]=	67.67186526	,
		[327]=	67.78323983	,
		[328]=	67.89444423	,
		[329]=	68.00547925	,
		[330]=	68.11634564	,
		[331]=	68.22704418	,
		[332]=	68.33757563	,
		[333]=	68.44794075	,
		[334]=	68.55814027	,
		[335]=	68.66817495	,
		[336]=	68.77804551	,
		[337]=	68.88775271	,
		[338]=	68.99729725	,
		[339]=	69.10667986	,
		[340]=	69.21590126	,
		[341]=	69.32496216	,
		[342]=	69.43386326	,
		[343]=	69.54260527	,
		[344]=	69.65118887	,
		[345]=	69.75961477	,
		[346]=	69.86788364	,
		[347]=	69.97599616	,
		[348]=	70.08395301	,
		[349]=	70.19175487	,
		[350]=	70.29940239	,
		[351]=	70.40689624	,
		[352]=	70.51423707	,
		[353]=	70.62142554	,
		[354]=	70.72846228	,
		[355]=	70.83534796	,
		[356]=	70.9420832	,
		[357]=	71.04866863	,
		[358]=	71.15510488	,
		[359]=	71.26139259	,
		[360]=	71.36753237	,
		[361]=	71.47352483	,
		[362]=	71.57937059	,
		[363]=	71.68507025	,
		[364]=	71.79062443	,
		[365]=	71.89603371	,
		[366]=	72.00129869	,
		[367]=	72.10641997	,
		[368]=	72.21139812	,
		[369]=	72.31623374	,
		[370]=	72.4209274	,
		[371]=	72.52547968	,
		[372]=	72.62989115	,
		[373]=	72.73416237	,
		[374]=	72.83829392	,
		[375]=	72.94228634	,
		[376]=	73.0461402	,
		[377]=	73.14985605	,
		[378]=	73.25343443	,
		[379]=	73.35687589	,
		[380]=	73.46018098	,
		[381]=	73.56335023	,
		[382]=	73.66638418	,
		[383]=	73.76928335	,
		[384]=	73.87204828	,
		[385]=	73.97467949	,
		[386]=	74.07717749	,
		[387]=	74.17954281	,
		[388]=	74.28177596	,
		[389]=	74.38387746	,
		[390]=	74.4858478	,
		[391]=	74.58768749	,
		[392]=	74.68939704	,
		[393]=	74.79097693	,
		[394]=	74.89242768	,
		[395]=	74.99374976	,
		[396]=	75.09494366	,
		[397]=	75.19600988	,
		[398]=	75.29694888	,
		[399]=	75.39776116	,
		[400]=	75.49844719	,
		[401]=	75.59900744	,
		[402]=	75.69944238	,
		[403]=	75.79975247	,
		[404]=	75.8999382	,
		[405]=	76	,
		[406]=	76.09993835	,
		[407]=	76.19975369	,
		[408]=	76.29944649	,
		[409]=	76.39901719	,
		[410]=	76.49846624	,
		[411]=	76.59779409	,
		[412]=	76.69700117	,
		[413]=	76.79608793	,
		[414]=	76.8950548	,
		[415]=	76.99390221	,
		[416]=	77.09263061	,
		[417]=	77.19124041	,
		[418]=	77.28973204	,
		[419]=	77.38810594	,
		[420]=	77.48636251	,
		[421]=	77.58450218	,
		[422]=	77.68252536	,
		[423]=	77.78043247	,
		[424]=	77.87822392	,
		[425]=	77.97590012	,
		[426]=	78.07346147	,
		[427]=	78.17090838	,
		[428]=	78.26824124	,
		[429]=	78.36546047	,
		[430]=	78.46256646	,
		[431]=	78.5595596	,
		[432]=	78.65644028	,
		[433]=	78.75320889	,
		[434]=	78.84986583	,
		[435]=	78.94641148	,
		[436]=	79.04284622	,
		[437]=	79.13917043	,
		[438]=	79.23538449	,
		[439]=	79.33148878	,
		[440]=	79.42748368	,
		[441]=	79.52336955	,
		[442]=	79.61914677	,
		[443]=	79.71481571	,
		[444]=	79.81037672	,
		[445]=	79.90583019	,
		[446]=	80.00117646	,
		[447]=	80.09641591	,
		[448]=	80.19154888	,
		[449]=	80.28657573	,
		[450]=	80.38149682	,
		[451]=	80.47631251	,
		[452]=	80.57102313	,
		[453]=	80.66562905	,
		[454]=	80.7601306	,
		[455]=	80.85452813	,
		[456]=	80.94882198	,
		[457]=	81.0430125	,
		[458]=	81.13710002	,
		[459]=	81.23108488	,
		[460]=	81.32496742	,
		[461]=	81.41874797	,
		[462]=	81.51242685	,
		[463]=	81.60600441	,
		[464]=	81.69948097	,
		[465]=	81.79285685	,
		[466]=	81.88613238	,
		[467]=	81.97930788	,
		[468]=	82.07238368	,
		[469]=	82.16536009	,
		[470]=	82.25823743	,
		[471]=	82.35101602	,
		[472]=	82.44369617	,
		[473]=	82.53627819	,
		[474]=	82.6287624	,
		[475]=	82.7211491	,
		[476]=	82.81343861	,
		[477]=	82.90563122	,
		[478]=	82.99772724	,
		[479]=	83.08972698	,
		[480]=	83.18163074	,
		[481]=	83.27343881	,
		[482]=	83.3651515	,
		[483]=	83.4567691	,
		[484]=	83.54829191	,
		[485]=	83.63972022	,
		[486]=	83.73105432	,
		[487]=	83.8222945	,
		[488]=	83.91344105	,
		[489]=	84.00449427	,
		[490]=	84.09545443	,
		[491]=	84.18632182	,
		[492]=	84.27709673	,
		[493]=	84.36777943	,
		[494]=	84.45837021	,
		[495]=	84.54886934	,
		[496]=	84.63927711	,
		[497]=	84.72959378	,
		[498]=	84.81981964	,
		[499]=	84.90995495	,
		[500]=	85	,
		[501]=	85.08995504	,
		[502]=	85.17982036	,
		[503]=	85.26959621	,
		[504]=	85.35928287	,
		[505]=	85.44888059	,
		[506]=	85.53838965	,
		[507]=	85.6278103	,
		[508]=	85.71714281	,
		[509]=	85.80638744	,
		[510]=	85.89554445	,
		[511]=	85.98461408	,
		[512]=	86.07359661	,
		[513]=	86.16249229	,
		[514]=	86.25130136	,
		[515]=	86.34002409	,
		[516]=	86.42866071	,
		[517]=	86.5172115	,
		[518]=	86.60567668	,
		[519]=	86.69405651	,
		[520]=	86.78235124	,
		[521]=	86.87056112	,
		[522]=	86.95868638	,
		[523]=	87.04672726	,
		[524]=	87.13468402	,
		[525]=	87.22255689	,
		[526]=	87.31034612	,
		[527]=	87.39805193	,
		[528]=	87.48567457	,
		[529]=	87.57321427	,
		[530]=	87.66067127	,
		[531]=	87.7480458	,
		[532]=	87.8353381	,
		[533]=	87.92254839	,
		[534]=	88.00967692	,
		[535]=	88.0967239	,
		[536]=	88.18368956	,
		[537]=	88.27057414	,
		[538]=	88.35737786	,
		[539]=	88.44410094	,
		[540]=	88.53074361	,
		[541]=	88.61730609	,
		[542]=	88.70378861	,
		[543]=	88.79019138	,
		[544]=	88.87651463	,
		[545]=	88.96275858	,
		[546]=	89.04892344	,
		[547]=	89.13500943	,
		[548]=	89.22101676	,
		[549]=	89.30694566	,
		[550]=	89.39279634	,
		[551]=	89.478569	,
		[552]=	89.56426386	,
		[553]=	89.64988114	,
		[554]=	89.73542104	,
		[555]=	89.82088378	,
		[556]=	89.90626955	,
		[557]=	89.99157857	,
		[558]=	90.07681105	,
		[559]=	90.16196719	,
		[560]=	90.2470472	,
		[561]=	90.33205127	,
		[562]=	90.41697962	,
		[563]=	90.50183244	,
		[564]=	90.58660994	,
		[565]=	90.67131231	,
		[566]=	90.75593976	,
		[567]=	90.84049249	,
		[568]=	90.92497068	,
		[569]=	91.00937454	,
		[570]=	91.09370427	,
		[571]=	91.17796005	,
		[572]=	91.26214209	,
		[573]=	91.34625058	,
		[574]=	91.4302857	,
		[575]=	91.51424765	,
		[576]=	91.59813663	,
		[577]=	91.68195281	,
		[578]=	91.7656964	,
		[579]=	91.84936758	,
		[580]=	91.93296653	,
		[581]=	92.01649344	,
		[582]=	92.09994851	,
		[583]=	92.1833319	,
		[584]=	92.26664382	,
		[585]=	92.34988444	,
		[586]=	92.43305394	,
		[587]=	92.51615251	,
		[588]=	92.59918032	,
		[589]=	92.68213757	,
		[590]=	92.76502442	,
		[591]=	92.84784106	,
		[592]=	92.93058766	,
		[593]=	93.01326441	,
		[594]=	93.09587147	,
		[595]=	93.17840903	,
		[596]=	93.26087726	,
		[597]=	93.34327633	,
		[598]=	93.42560642	,
		[599]=	93.50786771	,
		[600]=	93.59006035	,
		[601]=	93.67218453	,
		[602]=	93.75424042	,
		[603]=	93.83622818	,
		[604]=	93.91814798	,
		[605]=	94	,
		[606]=	94.0817844	,
		[607]=	94.16350135	,
		[608]=	94.24515102	,
		[609]=	94.32673356	,
		[610]=	94.40824915	,
		[611]=	94.48969796	,
		[612]=	94.57108014	,
		[613]=	94.65239586	,
		[614]=	94.73364528	,
		[615]=	94.81482856	,
		[616]=	94.89594586	,
		[617]=	94.97699735	,
		[618]=	95.05798319	,
		[619]=	95.13890353	,
		[620]=	95.21975853	,
		[621]=	95.30054835	,
		[622]=	95.38127315	,
		[623]=	95.46193309	,
		[624]=	95.54252832	,
		[625]=	95.62305899	,
		[626]=	95.70352526	,
		[627]=	95.78392729	,
		[628]=	95.86426523	,
		[629]=	95.94453923	,
		[630]=	96.02474944	,
		[631]=	96.10489602	,
		[632]=	96.18497912	,
		[633]=	96.26499889	,
		[634]=	96.34495547	,
		[635]=	96.42484903	,
		[636]=	96.5046797	,
		[637]=	96.58444763	,
		[638]=	96.66415297	,
		[639]=	96.74379588	,
		[640]=	96.82337649	,
		[641]=	96.90289495	,
		[642]=	96.98235141	,
		[643]=	97.06174602	,
		[644]=	97.14107891	,
		[645]=	97.22035022	,
		[646]=	97.29956012	,
		[647]=	97.37870872	,
		[648]=	97.45779619	,
		[649]=	97.53682265	,
		[650]=	97.61578826	,
		[651]=	97.69469314	,
		[652]=	97.77353745	,
		[653]=	97.85232132	,
		[654]=	97.93104488	,
		[655]=	98.00970828	,
		[656]=	98.08831166	,
		[657]=	98.16685514	,
		[658]=	98.24533888	,
		[659]=	98.323763	,
		[660]=	98.40212764	,
		[661]=	98.48043293	,
		[662]=	98.55867902	,
		[663]=	98.63686603	,
		[664]=	98.71499409	,
		[665]=	98.79306335	,
		[666]=	98.87107393	,
		[667]=	98.94902597	,
		[668]=	99.02691959	,
		[669]=	99.10475493	,
		[670]=	99.18253213	,
		[671]=	99.26025129	,
		[672]=	99.33791257	,
		[673]=	99.41551609	,
		[674]=	99.49306197	,
		[675]=	99.57055035	,
		[676]=	99.64798135	,
		[677]=	99.7253551	,
		[678]=	99.80267172	,
		[679]=	99.87993135	,
		[680]=	99.95713411	,
		[681]=	100.0342801	,
		[682]=	100.1113695	,
		[683]=	100.1884024	,
		[684]=	100.2653789	,
		[685]=	100.3422992	,
		[686]=	100.4191633	,
		[687]=	100.4959715	,
		[688]=	100.5727238	,
		[689]=	100.6494203	,
		[690]=	100.7260611	,
		[691]=	100.8026465	,
		[692]=	100.8791764	,
		[693]=	100.9556511	,
		[694]=	101.0320706	,
		[695]=	101.1084351	,
		[696]=	101.1847447	,
		[697]=	101.2609994	,
		[698]=	101.3371995	,
		[699]=	101.413345	,
		[700]=	101.4894361	,
		[701]=	101.5654728	,
		[702]=	101.6414554	,
		[703]=	101.7173838	,
		[704]=	101.7932582	,
		[705]=	101.8690788	,
		[706]=	101.9448456	,
		[707]=	102.0205588	,
		[708]=	102.0962184	,
		[709]=	102.1718247	,
		[710]=	102.2473776	,
		[711]=	102.3228773	,
		[712]=	102.398324	,
		[713]=	102.4737177	,
		[714]=	102.5490586	,
		[715]=	102.6243467	,
		[716]=	102.6995822	,
		[717]=	102.7747651	,
		[718]=	102.8498957	,
		[719]=	102.9249739	,
		[720]=	103	,
		[721]=	103.074974	,
		[722]=	103.149896	,
		[723]=	103.2247661	,
		[724]=	103.2995845	,
		[725]=	103.3743512	,
		[726]=	103.4490664	,
		[727]=	103.5237301	,
		[728]=	103.5983425	,
		[729]=	103.6729037	,
		[730]=	103.7474138	,
		[731]=	103.8218728	,
		[732]=	103.8962809	,
		[733]=	103.9706382	,
		[734]=	104.0449449	,
		[735]=	104.1192009	,
		[736]=	104.1934064	,
		[737]=	104.2675615	,
		[738]=	104.3416663	,
		[739]=	104.415721	,
		[740]=	104.4897255	,
		[741]=	104.5636801	,
		[742]=	104.6375848	,
		[743]=	104.7114397	,
		[744]=	104.7852449	,
		[745]=	104.8590005	,
		[746]=	104.9327067	,
		[747]=	105.0063635	,
		[748]=	105.0799709	,
		[749]=	105.1535292	,
		[750]=	105.2270384	,
		[751]=	105.3004986	,
		[752]=	105.37391	,
		[753]=	105.4472725	,
		[754]=	105.5205863	,
		[755]=	105.5938515	,
		[756]=	105.6670683	,
		[757]=	105.7402366	,
		[758]=	105.8133566	,
		[759]=	105.8864284	,
		[760]=	105.9594521	,
		[761]=	106.0324277	,
		[762]=	106.1053554	,
		[763]=	106.1782353	,
		[764]=	106.2510674	,
		[765]=	106.3238519	,
		[766]=	106.3965888	,
		[767]=	106.4692783	,
		[768]=	106.5419204	,
		[769]=	106.6145152	,
		[770]=	106.6870628	,
		[771]=	106.7595633	,
		[772]=	106.8320169	,
		[773]=	106.9044235	,
		[774]=	106.9767833	,
		[775]=	107.0490964	,
		[776]=	107.1213628	,
		[777]=	107.1935827	,
		[778]=	107.2657561	,
		[779]=	107.3378832	,
		[780]=	107.409964	,
		[781]=	107.4819986	,
		[782]=	107.553987	,
		[783]=	107.6259295	,
		[784]=	107.6978261	,
		[785]=	107.7696768	,
		[786]=	107.8414817	,
		[787]=	107.913241	,
		[788]=	107.9849548	,
		[789]=	108.056623	,
		[790]=	108.1282458	,
		[791]=	108.1998233	,
		[792]=	108.2713556	,
		[793]=	108.3428427	,
		[794]=	108.4142848	,
		[795]=	108.4856819	,
		[796]=	108.5570341	,
		[797]=	108.6283415	,
		[798]=	108.6996042	,
		[799]=	108.7708223	,
		[800]=	108.8419958	,
		[801]=	108.9131248	,
		[802]=	108.9842094	,
		[803]=	109.0552498	,
		[804]=	109.1262459	,
		[805]=	109.1971979	,
		[806]=	109.2681058	,
		[807]=	109.3389697	,
		[808]=	109.4097898	,
		[809]=	109.480566	,
		[810]=	109.5512986	,
		[811]=	109.6219874	,
		[812]=	109.6926327	,
		[813]=	109.7632345	,
		[814]=	109.8337929	,
		[815]=	109.904308	,
		[816]=	109.9747798	,
		[817]=	110.0452085	,
		[818]=	110.1155941	,
		[819]=	110.1859366	,
		[820]=	110.2562363	,
		[821]=	110.3264931	,
		[822]=	110.3967071	,
		[823]=	110.4668784	,
		[824]=	110.5370071	,
		[825]=	110.6070932	,
		[826]=	110.6771369	,
		[827]=	110.7471382	,
		[828]=	110.8170972	,
		[829]=	110.8870139	,
		[830]=	110.9568885	,
		[831]=	111.0267211	,
		[832]=	111.0965116	,
		[833]=	111.1662602	,
		[834]=	111.2359669	,
		[835]=	111.3056318	,
		[836]=	111.3752551	,
		[837]=	111.4448367	,
		[838]=	111.5143768	,
		[839]=	111.5838754	,
		[840]=	111.6533326	,
		[841]=	111.7227484	,
		[842]=	111.792123	,
		[843]=	111.8614564	,
		[844]=	111.9307487	,
		[845]=	112	,
		[846]=	112.0692103	,
		[847]=	112.1383797	,
		[848]=	112.2075083	,
		[849]=	112.2765961	,
		[850]=	112.3456433	,
		[851]=	112.4146499	,
		[852]=	112.4836159	,
		[853]=	112.5525414	,
		[854]=	112.6214266	,
		[855]=	112.6902715	,
		[856]=	112.7590761	,
		[857]=	112.8278405	,
		[858]=	112.8965648	,
		[859]=	112.9652491	,
		[860]=	113.0338934	,
		[861]=	113.1024979	,
		[862]=	113.1710624	,
		[863]=	113.2395873	,
		[864]=	113.3080724	,
		[865]=	113.3765179	,
		[866]=	113.4449239	,
		[867]=	113.5132904	,
		[868]=	113.5816175	,
		[869]=	113.6499052	,
		[870]=	113.7181536	,
		[871]=	113.7863629	,
		[872]=	113.8545329	,
		[873]=	113.9226639	,
		[874]=	113.9907559	,
		[875]=	114.058809	,
		[876]=	114.1268232	,
		[877]=	114.1947985	,
		[878]=	114.2627352	,
		[879]=	114.3306331	,
		[880]=	114.3984925	,
		[881]=	114.4663132	,
		[882]=	114.5340956	,
		[883]=	114.6018395	,
		[884]=	114.669545	,
		[885]=	114.7372123	,
		[886]=	114.8048413	,
		[887]=	114.8724322	,
		[888]=	114.939985	,
		[889]=	115.0074998	,
		[890]=	115.0749766	,
		[891]=	115.1424155	,
		[892]=	115.2098166	,
		[893]=	115.2771799	,
		[894]=	115.3445055	,
		[895]=	115.4117934	,
		[896]=	115.4790438	,
		[897]=	115.5462567	,
		[898]=	115.6134321	,
		[899]=	115.6805701	,
		[900]=	115.7476708	,
		[901]=	115.8147342	,
		[902]=	115.8817604	,
		[903]=	115.9487495	,
		[904]=	116.0157015	,
		[905]=	116.0826164	,
		[906]=	116.1494944	,
		[907]=	116.2163355	,
		[908]=	116.2831398	,
		[909]=	116.3499073	,
		[910]=	116.4166381	,
		[911]=	116.4833322	,
		[912]=	116.5499897	,
		[913]=	116.6166107	,
		[914]=	116.6831952	,
		[915]=	116.7497433	,
		[916]=	116.8162551	,
		[917]=	116.8827305	,
		[918]=	116.9491697	,
		[919]=	117.0155728	,
		[920]=	117.0819397	,
		[921]=	117.1482706	,
		[922]=	117.2145654	,
		[923]=	117.2808243	,
		[924]=	117.3470474	,
		[925]=	117.4132346	,
		[926]=	117.479386	,
		[927]=	117.5455018	,
		[928]=	117.6115818	,
		[929]=	117.6776263	,
		[930]=	117.7436353	,
		[931]=	117.8096087	,
		[932]=	117.8755468	,
		[933]=	117.9414495	,
		[934]=	118.0073169	,
		[935]=	118.073149	,
		[936]=	118.1389459	,
		[937]=	118.2047077	,
		[938]=	118.2704344	,
		[939]=	118.3361261	,
		[940]=	118.4017828	,
		[941]=	118.4674046	,
		[942]=	118.5329915	,
		[943]=	118.5985437	,
		[944]=	118.6640611	,
		[945]=	118.7295438	,
		[946]=	118.7949918	,
		[947]=	118.8604053	,
		[948]=	118.9257842	,
		[949]=	118.9911287	,
		[950]=	119.0564388	,
		[951]=	119.1217145	,
		[952]=	119.1869558	,
		[953]=	119.252163	,
		[954]=	119.3173359	,
		[955]=	119.3824746	,
		[956]=	119.4475793	,
		[957]=	119.51265	,
		[958]=	119.5776866	,
		[959]=	119.6426893	,
		[960]=	119.7076581	,
		[961]=	119.7725931	,
		[962]=	119.8374944	,
		[963]=	119.9023619	,
		[964]=	119.9671957	,
		[965]=	120.0319959	,
		[966]=	120.0967625	,
		[967]=	120.1614957	,
		[968]=	120.2261953	,
		[969]=	120.2908616	,
		[970]=	120.3554945	,
		[971]=	120.4200941	,
		[972]=	120.4846604	,
		[973]=	120.5491935	,
		[974]=	120.6136935	,
		[975]=	120.6781604	,
		[976]=	120.7425942	,
		[977]=	120.806995	,
		[978]=	120.8713629	,
		[979]=	120.9356979	,
		[980]=	121	,
		[981]=	121.0642693	,
		[982]=	121.1285059	,
		[983]=	121.1927098	,
		[984]=	121.256881	,
		[985]=	121.3210196	,
		[986]=	121.3851257	,
		[987]=	121.4491993	,
		[988]=	121.5132404	,
		[989]=	121.5772491	,
		[990]=	121.6412255	,
		[991]=	121.7051696	,
		[992]=	121.7690814	,
		[993]=	121.832961	,
		[994]=	121.8968085	,
		[995]=	121.9606238	,
		[996]=	122.0244071	,
		[997]=	122.0881584	,
		[998]=	122.1518777	,
		[999]=	122.2155651	,
		[1000]=	122.2792206	,
	}
	local true_idx = (target_distance - accum_distance);

	if (true_idx <= 0)
	{
		return 10.0;
	}
	else if (true_idx > 1000)
	{
		return incoming_pattern_table[1000];
	}
	else
	{
		true_idx = true_idx - (true_idx % 4);
		return incoming_pattern_table[true_idx.tointeger()];
	}
}

function self_erase(accum_distance, target_distance)
{
	if ((target_distance - accum_distance) <= -50.0)
	{
		return true;
	}
	else
	{
		return false;
	}
}

function pattern_type(param)
{
	return 0;
}